#include<iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int cnt = 0;
	int t = n;
	if (n == 0) {
		cout << "0000" << endl;
		return 0;
	}
	while (t) {
		cnt++;
		t /= 10;
	}
	if (cnt == 4) {
		cout << n << endl;
	}
	else {
		for (int i = 0; i < 4 - cnt; i++) {
			cout << 0;
		}
		cout << n << endl;
	}
	return 0;
}